Homework #3

Author

Natalie Mayer

Code
library(tidyverse)
library(here)
library(janitor)
library(lubridate)
library(stringr)

ca_rights <- read_csv(here("data", "california.csv"))

Question 1

I plan to pursue Option 1: Infographic.

Question 2

My overarching question is “How does California’s water rights system influence water availability and allocation across different sectors?”. The three sub-questions are:

  1. How does California’s water rights legal framework compare to other states?

  2. Which water use sectors hold the most senior (older) water rights?

  3. How did appropriations for each sector grown between 1930-1999?

Question 3

For the choropleth map showing legal water rights framework for each of the states in the U.S., I created my own dataframe with two categorical variables: State name and Legal framework. The textbook from ESM 225: Water Policy (A Twenty-First Century U.S. Water Policy by Juliet Christian-Smith and Peter H. Gleick) includes tables of what legal system is used to govern water rights appropriations in each state. I joined this to the National Weather Service’s U.S. States and Territories shapefile for variables including: location (latitude, longitude) and shape of United States.

For the bar chart, I used data from the Har-DWR Cumulative Water Rights Curves (Lisk et al. 2023) data set. Specifically, the variables I used were designated water use (waterUse), the rate of water appropriated (cfs), and the date the water right was appropriated (priorityDate). I summed the appropriated water (cfs) for each designated use (waterUse) by decade using (priorityDate) to show which sectors have more senior water rights in California.

For the line graph, I used data from the Har-DWR Cumulative Water Rights Curves (Lisk et al. 2023) data set. Specifically, the variables I used were designated water use (waterUse), the rate of water appropriated (cfs), and the date the water right was appropriated (priorityDate). I calculated the aggregated sum of appropriated water (cfs) for each designated use (waterUse) for each year (priorityDate) to show how total amount of water appropriated has grown since 1930.

Question 4

I want to borrow from this NY Times graphic on Sea ice area below the qualitative y-axis labels to represent flow rate quantities.

I want to borrow from this choropleth of the US the placement of the legend on top to reduce viewer eye movement.

Question 5

Question 6

Plot 2: CA Water Rights Uses by Decade

The purpose of this visualization is to show which water uses have priority over others. Due to the legal framework of water rights in CA (prior appropriation), older water rights are prioritized during times of water scarcity.

Code
# create color palette for water uses
water_use_pal <- c("Domestic" = "#9b1b34", 
                   "Environment" = "#93afce", 
                   "Industrial" = "#4a4343", 
                   "Agriculture" = "#d8a451")

# group cfs by decade and water use
ca_rights_use <- ca_rights %>%
  clean_names() %>%
  select(priority_date, cfs, water_use) %>%
  mutate(date = mdy(priority_date)) %>%
  mutate(date = if_else(year(date) > 2023, date - years(100), date)) %>%
  mutate(year = year(date))%>%
  filter(year > 1929) %>%
  filter(year < 2000) %>%
  mutate(decade = case_when(
    year %in% (1930:1939) ~ "1930s", 
    year %in% c(1940:1949) ~ "1940s", 
    year %in% (1950:1959) ~ "1950s", 
    year %in% c(1960:1969) ~ "1960s",
    year %in% (1970:1979) ~ "1970s", 
    year %in% c(1980:1989) ~ "1980s",
    year %in% c(1990:1999) ~ "1990s"
  )) %>%
  select(decade, cfs, water_use) %>%
  group_by(decade, water_use) %>%
  summarise(cfs = sum(cfs)) %>%
  ungroup() %>%
  filter(water_use != "other") %>%
  mutate(water_use = case_when(
    water_use %in% c("livestock", "irrigation") ~ "Agriculture",
    water_use %in% c("environmental", "fish") ~ "Environment",
    water_use == "industrial" ~ "Industrial",
    water_use == "domestic" ~ "Domestic")) %>%
  drop_na() %>%
  group_by(decade) %>%
  arrange(decade, desc(cfs)) %>%
  mutate(water_use = factor(water_use, levels = unique(water_use))) %>%
  ungroup()

# create bar chart of appropriated water for each use by decade
ggplot(data = ca_rights_use, 
       aes(x = decade, y = cfs, fill = water_use)) + 
  geom_col(position = "dodge") + 
  scale_fill_manual(values = water_use_pal) + 
  scale_y_continuous(labels = scales::label_number(accuracy = 1, scale = 0.001, suffix = "K"),
                     expand = c(0,0)) +
  theme_classic() + 
  labs(subtitle = "Older water rights are more senior and are prioritized when water is scarce", 
       title = "Most California water rights are appropriated for industrial and domestic use",
       x = " ", 
       y = "Appropriated Water (CFS)", 
       fill = "Water Use",
       caption = "Data Source: HarDWR - Cumulative Water Rights Curves (Lisk et al. 2023)") + 
  theme(
    plot.title.position = "plot",
    plot.title = element_text(face = "bold"),
    plot.caption = element_text(hjust = 0.5),
    
    legend.position = "bottom", 
    
    axis.text = element_text(color = "black")) + 
  coord_fixed(ratio = 0.00003)

Plot 3: Relative change in appropriated water volume and annual runoff

Code
# create a df of cumulative sum of appropriated cfs for each use by year
ca_rights_ts <- ca_rights %>%
  clean_names() %>%
  select(priority_date, cfs, water_use) %>%
  mutate(date = mdy(priority_date)) %>%
  mutate(date = if_else(year(date) > 2023, date - years(100), date)) %>%
  mutate(year = year(date)) %>%
  filter(year > 1929) %>%
  filter(year < 2000) %>%
  group_by(year, water_use) %>%
  summarise(cfs = sum(cfs)) %>%
  ungroup() %>%
  filter(water_use != "other") %>%
  mutate(water_use = case_when(
    water_use %in% c("livestock", "irrigation") ~ "Agriculture",
    water_use %in% c("environmental", "fish") ~ "Environment",
    water_use == "industrial" ~ "Industrial",
    water_use == "domestic" ~ "Domestic"
  )) %>%
  arrange(water_use, year) %>%  
  group_by(water_use) %>%     
  mutate(agg_cfs = cumsum(cfs)) %>%  
  ungroup()
Code
# create line graph showing growth in annual appropriations of water by designated use
ggplot() + 
  geom_line(data = ca_rights_ts, 
            mapping = aes(x = year, y = agg_cfs, color = water_use), 
            linewidth = 1)+
  geom_hline(aes(yintercept = 36000), color = "lightblue", linetype = "dashed") + # max oroville dam cfs
  theme_classic() + 
  scale_y_continuous(expand = c(0,0),
                     labels = scales::label_number(accuracy = 1, scale = 0.001, suffix = "K")) +
  scale_x_continuous(breaks = seq(min(ca_rights_ts$year), max(ca_rights_ts$year), by = 10), 
                     expand = c(0,0)) + 
  coord_fixed(ratio = 0.00008) + 
  scale_color_manual(values = water_use_pal) +
  labs(y = "Appropriated Water (CFS)", 
       x = " ") + 
  annotate(
    geom = "text", 
    x = 1993, 
    y = 415000,
    label = "Industrial",
    size = 3.5,
    color = "#4a4343") + 
  annotate(
    geom = "text", 
    x = 1994, 
    y = 255000,
    label = "Domestic",
    size = 3.5,
    color = "#9b1b34") + 
  annotate(
    geom = "text", 
    x = 1986, 
    y = 190500,
    label = "Environment",
    size = 3.5,
    color = "#93afce") + 
  annotate(
    geom = "text", 
    x = 1992, 
    y = 158000,
    label = "Agriculture",
    size = 3.5,
    color = "#d8a451") + 
  annotate(
    geom = "text", 
    x = 1981, 
    y = 55000,
    label = "Maximum flow out of the Oroville Dam (36,000 CFS)",
    size = 2.5,
    color = "black") + 
  labs(title = "Growth of CA Appropriated Water Rights (1930-1999) by Beneficial Use",
       subtitle = "The Oroville Dam, the largest in the U.S. and the main reservoir of the State Water Project,\nserves as a reference for growing water appropriations, which have significantly increased\nparticularly for industrial use",
       caption = "Data Source: HarDWR - Cumulative Water Rights Curves (Lisk et al. 2023)",
       color = "Water Use") + 
  theme(plot.title.position = "plot", 
        plot.title = element_text(face = "bold"), 
        plot.caption = element_text(hjust = 0.5),
        legend.position = "bottom",
        
        axis.text = element_text(color = "black"), 
        axis.title.y = element_text(margin = margin(t = 0, r = 10, b = 0, l = 0))
        )

Question 7

a) My biggest challenge is trying to provide a reference for the units of appropriated water in a way that a non-expert can understand without over-explaining. I tried to do this in Plot 3 by adding a horizontal line of the maximum outflow from the Oroville Dam, but I think instead I will add qualitative labels on the y-axis for some of the CFS quantities (such as in the sea ice example from the NY Times) that put into context how much water is appropriated for each use.

b) I have not used any extension packages yet, but I intend to customize the text using ggtext.

c) It would be useful to know if the graphs are communicating their intended purpose to an audience that are not experts in water rights legal frameworks, and if the color palettes and overall balance of the graphics are accessible and aesthetically pleasing.